import warnings
warnings.filterwarnings('ignore')
from ultralytics import YOLO

if __name__ == '__main__':
    model = YOLO('runs/train/exp3/weights/best.pt') # select your model.pt path
    #model.predict(source='ultralytics/assets/screw.jpg',
    #              imgsz=640,
     #             project='runs/detect',
    #              name='exp',
     #             save=True,
     #             classes=2,
     #           )
    results = model(r"ultralytics/assets/screw.jpg", save=True, conf=0.5)  # predict on an image